#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Sascha Schade
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------


def init(module):
    module.name = ":driver:pca9548a"
    module.description = """\
PCA9548A/TCA9548A I2C Switch

This bidirectional 8-channel switch with reset
can be used to multiplex I2C busses.
"""

def prepare(module, options):
    module.depends(
        ":architecture:i2c.device",
        ":architecture:i2c.multiplexer",
        ":processing:resumable")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/driver/gpio"
    env.copy("pca9548a.hpp")
    env.copy("pca9548a_impl.hpp")
